{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<!--BOOK_INFORMATION-->\n",
    "<a href=\"https://user-images.githubusercontent.com/19553554/71825144-2d568180-30d6-11ea-8ee0-63c849cfd934.png\" target=\"_blank\"><img align=\"left\" style=\"width: 76px; height: 100px; background: white; padding: 1px; border: 1px solid black; margin-right:10px;\"></a>\n",
    "*pyecharts 是一个用于生成 Echarts 图表的类库。Echarts 是百度开源的一个数据可视化 JS 库。用 Echarts 生成的图可视化效果非常棒，为了与 Python 进行对接，方便在 Python 中直接使用数据生成图，于是有人开发出了这个项目[GitHub](https://github.com/pyecharts/pyecharts) .*\n",
    "\n",
    "*Note.建议本程序在参看https://github.com/pyecharts/pyecharts 的安装步骤后再运行； 本程序所有的例子都是从官方提供的样例代码[GitHub](https://github.com/pyecharts/pyecharts-gallery)中提取的,如果对某个API有疑问建议在IDE里面查看*\n",
    "\n",
    "*Echart类型图种大全:https://echarts.apache.org/examples/zh/#chart-type-line pyecharts图导入到ppt中的方法:https://baijiahao.baidu.com/s?id=1663839456876951842&wfr=spider&for=pc.*\n",
    "\n",
    "*作者: LBQ; 时间:2020/7/24. 邮箱:779660843@qq.com*"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Ⅳ.盒式图(Boxplot)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 基础示例"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/fisadm/anaconda3/envs/detectron2/lib/python3.7/site-packages/pyecharts/charts/chart.py:14: PendingDeprecationWarning: pyecharts 所有图表类型将在 v1.9.0 版本开始强制使用 ChartItem 进行数据项配置 :)\n",
      "  super().__init__(init_opts=init_opts)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"3b6a0e963b9a4258b212669aa8d9db78\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_3b6a0e963b9a4258b212669aa8d9db78 = echarts.init(\n",
       "                    document.getElementById('3b6a0e963b9a4258b212669aa8d9db78'), 'white', {renderer: 'canvas'});\n",
       "                var option_3b6a0e963b9a4258b212669aa8d9db78 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"boxplot\",\n",
       "            \"name\": \"A\",\n",
       "            \"data\": [\n",
       "                [\n",
       "                    740,\n",
       "                    857.5,\n",
       "                    940.0,\n",
       "                    980.0,\n",
       "                    1070\n",
       "                ],\n",
       "                [\n",
       "                    790,\n",
       "                    832.5,\n",
       "                    880.0,\n",
       "                    940.0,\n",
       "                    960\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"label\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"inside\",\n",
       "                    \"color\": \"#fff\",\n",
       "                    \"margin\": 8\n",
       "                }\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"silent\": false,\n",
       "                \"precision\": 2,\n",
       "                \"label\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"top\",\n",
       "                    \"margin\": 8\n",
       "                }\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"boxplot\",\n",
       "            \"name\": \"B\",\n",
       "            \"data\": [\n",
       "                [\n",
       "                    740,\n",
       "                    760.0,\n",
       "                    805.0,\n",
       "                    872.5,\n",
       "                    920\n",
       "                ],\n",
       "                [\n",
       "                    760,\n",
       "                    795.0,\n",
       "                    815.0,\n",
       "                    865.0,\n",
       "                    890\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"label\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"inside\",\n",
       "                    \"color\": \"#fff\",\n",
       "                    \"margin\": 8\n",
       "                }\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"silent\": false,\n",
       "                \"precision\": 2,\n",
       "                \"label\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"top\",\n",
       "                    \"margin\": 8\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"A\",\n",
       "                \"B\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"A\": true,\n",
       "                \"B\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"expr1\",\n",
       "                \"expr2\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"BoxPlot-\\u57fa\\u672c\\u793a\\u4f8b\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_3b6a0e963b9a4258b212669aa8d9db78.setOption(option_3b6a0e963b9a4258b212669aa8d9db78);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x7f4197619710>"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Boxplot\n",
    "\n",
    "v1 = [\n",
    "    [850, 740, 900, 1070, 930, 850, 950, 980, 980, 880, 1000, 980],\n",
    "    [960, 940, 960, 940, 880, 800, 850, 880, 900, 840, 830, 790],\n",
    "]\n",
    "v2 = [\n",
    "    [890, 810, 810, 820, 800, 770, 760, 740, 750, 760, 910, 920],\n",
    "    [890, 840, 780, 810, 760, 810, 790, 810, 820, 850, 870, 870],\n",
    "]\n",
    "c = Boxplot()\n",
    "c.add_xaxis([\"expr1\", \"expr2\"])\n",
    "c.add_yaxis(\"A\", c.prepare_data(v1))\n",
    "c.add_yaxis(\"B\", c.prepare_data(v2))\n",
    "c.set_global_opts(title_opts=opts.TitleOpts(title=\"BoxPlot-基本示例\"))\n",
    "#c.render(\"boxplot_base.html\")\n",
    "c.load_javascript()\n",
    "c.render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 盒须图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/fisadm/anaconda3/envs/detectron2/lib/python3.7/site-packages/pyecharts/charts/chart.py:14: PendingDeprecationWarning: pyecharts 所有图表类型将在 v1.9.0 版本开始强制使用 ChartItem 进行数据项配置 :)\n",
      "  super().__init__(init_opts=init_opts)\n",
      "/home/fisadm/anaconda3/envs/detectron2/lib/python3.7/site-packages/pyecharts/charts/chart.py:14: PendingDeprecationWarning: pyecharts 所有图表类型将在 v1.9.0 版本开始强制使用 ChartItem 进行数据项配置 :)\n",
      "  super().__init__(init_opts=init_opts)\n",
      "/home/fisadm/anaconda3/envs/detectron2/lib/python3.7/site-packages/pyecharts/charts/composite_charts/grid.py:17: PendingDeprecationWarning: pyecharts 所有图表类型将在 v1.9.0 版本开始强制使用 ChartItem 进行数据项配置 :)\n",
      "  super().__init__(init_opts=init_opts)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"c17ebc8ca9d647c3aee71d64dd3fe1f3\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_c17ebc8ca9d647c3aee71d64dd3fe1f3 = echarts.init(\n",
       "                    document.getElementById('c17ebc8ca9d647c3aee71d64dd3fe1f3'), 'white', {renderer: 'canvas'});\n",
       "                var option_c17ebc8ca9d647c3aee71d64dd3fe1f3 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"boxplot\",\n",
       "            \"xAxisIndex\": 0,\n",
       "            \"yAxisIndex\": 0,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    650,\n",
       "                    850.0,\n",
       "                    940.0,\n",
       "                    980.0,\n",
       "                    1070\n",
       "                ],\n",
       "                [\n",
       "                    760,\n",
       "                    800.0,\n",
       "                    845.0,\n",
       "                    895.0,\n",
       "                    960\n",
       "                ],\n",
       "                [\n",
       "                    620,\n",
       "                    840.0,\n",
       "                    855.0,\n",
       "                    880.0,\n",
       "                    970\n",
       "                ],\n",
       "                [\n",
       "                    720,\n",
       "                    762.5,\n",
       "                    815.0,\n",
       "                    875.0,\n",
       "                    920\n",
       "                ],\n",
       "                [\n",
       "                    740,\n",
       "                    802.5,\n",
       "                    810.0,\n",
       "                    870.0,\n",
       "                    950\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"label\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"inside\",\n",
       "                    \"color\": \"#fff\",\n",
       "                    \"margin\": 8\n",
       "                }\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"silent\": false,\n",
       "                \"precision\": 2,\n",
       "                \"label\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"top\",\n",
       "                    \"margin\": 8\n",
       "                }\n",
       "            },\n",
       "            \"tooltip\": {\n",
       "                \"show\": true,\n",
       "                \"trigger\": \"item\",\n",
       "                \"triggerOn\": \"mousemove|click\",\n",
       "                \"axisPointer\": {\n",
       "                    \"type\": \"line\"\n",
       "                },\n",
       "                \"showContent\": true,\n",
       "                \"alwaysShowContent\": false,\n",
       "                \"showDelay\": 0,\n",
       "                \"hideDelay\": 100,\n",
       "                \"formatter\": \"{b}: {c}\",\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 14\n",
       "                },\n",
       "                \"borderWidth\": 0,\n",
       "                \"padding\": 5\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"scatter\",\n",
       "            \"xAxisIndex\": 1,\n",
       "            \"yAxisIndex\": 1,\n",
       "            \"symbolSize\": 10,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"expr 0\",\n",
       "                    650\n",
       "                ],\n",
       "                [\n",
       "                    \"expr 1\",\n",
       "                    620\n",
       "                ],\n",
       "                [\n",
       "                    \"expr 2\",\n",
       "                    720\n",
       "                ],\n",
       "                [\n",
       "                    \"expr 3\",\n",
       "                    720\n",
       "                ],\n",
       "                [\n",
       "                    \"expr 4\",\n",
       "                    950\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"right\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        },\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"shadow\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"type\": \"category\",\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"axisLabel\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8,\n",
       "                \"formatter\": \"expr {value}\"\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"boundaryGap\": true,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"splitArea\": {\n",
       "                \"show\": false,\n",
       "                \"areaStyle\": {\n",
       "                    \"opacity\": 0\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"expr 0\",\n",
       "                \"expr 1\",\n",
       "                \"expr 2\",\n",
       "                \"expr 3\",\n",
       "                \"expr 4\"\n",
       "            ]\n",
       "        },\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 1,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"expr 0\",\n",
       "                \"expr 1\",\n",
       "                \"expr 2\",\n",
       "                \"expr 3\",\n",
       "                \"expr 4\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"type\": \"value\",\n",
       "            \"name\": \"km/s minus 299,000\",\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"splitArea\": {\n",
       "                \"show\": true,\n",
       "                \"areaStyle\": {\n",
       "                    \"opacity\": 1\n",
       "                }\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 1,\n",
       "            \"axisTick\": {\n",
       "                \"show\": false,\n",
       "                \"alignWithLabel\": false,\n",
       "                \"inside\": false\n",
       "            },\n",
       "            \"axisLabel\": {\n",
       "                \"show\": false,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Michelson-Morley Experiment\",\n",
       "            \"left\": \"center\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        },\n",
       "        {\n",
       "            \"text\": \"upper: Q3 + 1.5 * IQR \\nlower: Q1 - 1.5 * IQR\",\n",
       "            \"left\": \"10%\",\n",
       "            \"top\": \"90%\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"textStyle\": {\n",
       "                \"fontSize\": 14,\n",
       "                \"borderColor\": \"#999\",\n",
       "                \"borderWidth\": 1\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"grid\": [\n",
       "        {\n",
       "            \"show\": false,\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 2,\n",
       "            \"left\": \"10%\",\n",
       "            \"right\": \"10%\",\n",
       "            \"bottom\": \"15%\",\n",
       "            \"containLabel\": false,\n",
       "            \"backgroundColor\": \"transparent\",\n",
       "            \"borderColor\": \"#ccc\",\n",
       "            \"borderWidth\": 1\n",
       "        },\n",
       "        {\n",
       "            \"show\": false,\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 2,\n",
       "            \"left\": \"10%\",\n",
       "            \"right\": \"10%\",\n",
       "            \"bottom\": \"15%\",\n",
       "            \"containLabel\": false,\n",
       "            \"backgroundColor\": \"transparent\",\n",
       "            \"borderColor\": \"#ccc\",\n",
       "            \"borderWidth\": 1\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_c17ebc8ca9d647c3aee71d64dd3fe1f3.setOption(option_c17ebc8ca9d647c3aee71d64dd3fe1f3);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x7f41ac1460f0>"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts.charts import Grid, Boxplot, Scatter\n",
    "y_data = [\n",
    "    [\n",
    "        850,\n",
    "        740,\n",
    "        900,\n",
    "        1070,\n",
    "        930,\n",
    "        850,\n",
    "        950,\n",
    "        980,\n",
    "        980,\n",
    "        880,\n",
    "        1000,\n",
    "        980,\n",
    "        930,\n",
    "        650,\n",
    "        760,\n",
    "        810,\n",
    "        1000,\n",
    "        1000,\n",
    "        960,\n",
    "        960,\n",
    "    ],\n",
    "    [\n",
    "        960,\n",
    "        940,\n",
    "        960,\n",
    "        940,\n",
    "        880,\n",
    "        800,\n",
    "        850,\n",
    "        880,\n",
    "        900,\n",
    "        840,\n",
    "        830,\n",
    "        790,\n",
    "        810,\n",
    "        880,\n",
    "        880,\n",
    "        830,\n",
    "        800,\n",
    "        790,\n",
    "        760,\n",
    "        800,\n",
    "    ],\n",
    "    [\n",
    "        880,\n",
    "        880,\n",
    "        880,\n",
    "        860,\n",
    "        720,\n",
    "        720,\n",
    "        620,\n",
    "        860,\n",
    "        970,\n",
    "        950,\n",
    "        880,\n",
    "        910,\n",
    "        850,\n",
    "        870,\n",
    "        840,\n",
    "        840,\n",
    "        850,\n",
    "        840,\n",
    "        840,\n",
    "        840,\n",
    "    ],\n",
    "    [\n",
    "        890,\n",
    "        810,\n",
    "        810,\n",
    "        820,\n",
    "        800,\n",
    "        770,\n",
    "        760,\n",
    "        740,\n",
    "        750,\n",
    "        760,\n",
    "        910,\n",
    "        920,\n",
    "        890,\n",
    "        860,\n",
    "        880,\n",
    "        720,\n",
    "        840,\n",
    "        850,\n",
    "        850,\n",
    "        780,\n",
    "    ],\n",
    "    [\n",
    "        890,\n",
    "        840,\n",
    "        780,\n",
    "        810,\n",
    "        760,\n",
    "        810,\n",
    "        790,\n",
    "        810,\n",
    "        820,\n",
    "        850,\n",
    "        870,\n",
    "        870,\n",
    "        810,\n",
    "        740,\n",
    "        810,\n",
    "        940,\n",
    "        950,\n",
    "        800,\n",
    "        810,\n",
    "        870,\n",
    "    ],\n",
    "]\n",
    "scatter_data = [650, 620, 720, 720, 950, 970]\n",
    "\n",
    "box_plot = Boxplot()\n",
    "\n",
    "box_plot = (\n",
    "    box_plot.add_xaxis(xaxis_data=[\"expr 0\", \"expr 1\", \"expr 2\", \"expr 3\", \"expr 4\"])\n",
    "    .add_yaxis(series_name=\"\", y_axis=box_plot.prepare_data(y_data))\n",
    "    .set_global_opts(\n",
    "        title_opts=opts.TitleOpts(\n",
    "            pos_left=\"center\", title=\"Michelson-Morley Experiment\"\n",
    "        ),\n",
    "        tooltip_opts=opts.TooltipOpts(trigger=\"item\", axis_pointer_type=\"shadow\"),\n",
    "        xaxis_opts=opts.AxisOpts(\n",
    "            type_=\"category\",\n",
    "            boundary_gap=True,\n",
    "            splitarea_opts=opts.SplitAreaOpts(is_show=False),\n",
    "            axislabel_opts=opts.LabelOpts(formatter=\"expr {value}\"),\n",
    "            splitline_opts=opts.SplitLineOpts(is_show=False),\n",
    "        ),\n",
    "        yaxis_opts=opts.AxisOpts(\n",
    "            type_=\"value\",\n",
    "            name=\"km/s minus 299,000\",\n",
    "            splitarea_opts=opts.SplitAreaOpts(\n",
    "                is_show=True, areastyle_opts=opts.AreaStyleOpts(opacity=1)\n",
    "            ),\n",
    "        ),\n",
    "    )\n",
    "    .set_series_opts(tooltip_opts=opts.TooltipOpts(formatter=\"{b}: {c}\"))\n",
    ")\n",
    "\n",
    "scatter = (\n",
    "    Scatter()\n",
    "    .add_xaxis(xaxis_data=[\"expr 0\", \"expr 1\", \"expr 2\", \"expr 3\", \"expr 4\"])\n",
    "    .add_yaxis(series_name=\"\", y_axis=scatter_data)\n",
    "    .set_global_opts(\n",
    "        title_opts=opts.TitleOpts(\n",
    "            pos_left=\"10%\",\n",
    "            pos_top=\"90%\",\n",
    "            title=\"upper: Q3 + 1.5 * IQR \\nlower: Q1 - 1.5 * IQR\",\n",
    "            title_textstyle_opts=opts.TextStyleOpts(\n",
    "                border_color=\"#999\", border_width=1, font_size=14\n",
    "            ),\n",
    "        ),\n",
    "        yaxis_opts=opts.AxisOpts(\n",
    "            axislabel_opts=opts.LabelOpts(is_show=False),\n",
    "            axistick_opts=opts.AxisTickOpts(is_show=False),\n",
    "        ),\n",
    "    )\n",
    ")\n",
    "\n",
    "grid = (\n",
    "    Grid()\n",
    "    .add(\n",
    "        box_plot,\n",
    "        grid_opts=opts.GridOpts(pos_left=\"10%\", pos_right=\"10%\", pos_bottom=\"15%\"),\n",
    "    )\n",
    "    .add(\n",
    "        scatter,\n",
    "        grid_opts=opts.GridOpts(pos_left=\"10%\", pos_right=\"10%\", pos_bottom=\"15%\"),\n",
    "    )\n",
    "    #.render(\"boxplot_light_velocity.html\")\n",
    ")\n",
    "grid.load_javascript()\n",
    "grid.render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 多类盒状图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/fisadm/anaconda3/envs/detectron2/lib/python3.7/site-packages/pyecharts/charts/chart.py:14: PendingDeprecationWarning: pyecharts 所有图表类型将在 v1.9.0 版本开始强制使用 ChartItem 进行数据项配置 :)\n",
      "  super().__init__(init_opts=init_opts)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"22cb15d67b23406cb56876db2474c2fb\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_22cb15d67b23406cb56876db2474c2fb = echarts.init(\n",
       "                    document.getElementById('22cb15d67b23406cb56876db2474c2fb'), 'white', {renderer: 'canvas'});\n",
       "                var option_22cb15d67b23406cb56876db2474c2fb = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"boxplot\",\n",
       "            \"name\": \"category0\",\n",
       "            \"data\": [\n",
       "                [\n",
       "                    3.8888578346043534,\n",
       "                    55.82692798765428,\n",
       "                    98.71608835477272,\n",
       "                    149.50917642877687,\n",
       "                    196.31621070646452\n",
       "                ],\n",
       "                [\n",
       "                    0.5174326704765253,\n",
       "                    47.52990128406776,\n",
       "                    103.66600287106233,\n",
       "                    160.1380046605997,\n",
       "                    194.8294269298398\n",
       "                ],\n",
       "                [\n",
       "                    2.843900448603165,\n",
       "                    51.773788199388605,\n",
       "                    90.66830693679475,\n",
       "                    152.19938074181786,\n",
       "                    196.18172012742428\n",
       "                ],\n",
       "                [\n",
       "                    2.6752702891334135,\n",
       "                    42.85051429480143,\n",
       "                    98.54433643572133,\n",
       "                    166.81852013033875,\n",
       "                    199.7400516615198\n",
       "                ],\n",
       "                [\n",
       "                    1.665511467481906,\n",
       "                    63.069856326089585,\n",
       "                    123.20638438572043,\n",
       "                    164.0932194814393,\n",
       "                    199.56631692214057\n",
       "                ],\n",
       "                [\n",
       "                    0.3597414263118992,\n",
       "                    52.84424125860876,\n",
       "                    108.14491539985673,\n",
       "                    154.42390255012828,\n",
       "                    199.39872381823812\n",
       "                ],\n",
       "                [\n",
       "                    1.3380322954592128,\n",
       "                    41.989379994726335,\n",
       "                    100.39118095266713,\n",
       "                    160.38742881881478,\n",
       "                    197.8251968350275\n",
       "                ],\n",
       "                [\n",
       "                    1.7005873932608662,\n",
       "                    43.88170786936796,\n",
       "                    92.29415890464293,\n",
       "                    140.7858956683471,\n",
       "                    197.50510824352313\n",
       "                ],\n",
       "                [\n",
       "                    1.7017445023542965,\n",
       "                    52.55872982785781,\n",
       "                    90.26972335102536,\n",
       "                    155.43082163069883,\n",
       "                    198.31679368721197\n",
       "                ],\n",
       "                [\n",
       "                    0.45657888665799895,\n",
       "                    47.60747957375436,\n",
       "                    95.53917053451289,\n",
       "                    162.55256484073354,\n",
       "                    199.78317232079928\n",
       "                ],\n",
       "                [\n",
       "                    1.745438082254136,\n",
       "                    53.450845301261964,\n",
       "                    95.8847297380051,\n",
       "                    143.99885640751006,\n",
       "                    195.1863502057908\n",
       "                ],\n",
       "                [\n",
       "                    2.5631287114048273,\n",
       "                    56.04486879215165,\n",
       "                    110.01592256847306,\n",
       "                    155.33508398386462,\n",
       "                    195.90291395560985\n",
       "                ],\n",
       "                [\n",
       "                    3.4380745785991262,\n",
       "                    58.07888602010247,\n",
       "                    105.64925213947652,\n",
       "                    165.50126442985191,\n",
       "                    199.75877487248675\n",
       "                ],\n",
       "                [\n",
       "                    0.03322930419802361,\n",
       "                    53.363159200883985,\n",
       "                    95.32936635574816,\n",
       "                    151.39772626598614,\n",
       "                    198.20394907387762\n",
       "                ],\n",
       "                [\n",
       "                    0.7063564158257929,\n",
       "                    73.89369564248534,\n",
       "                    116.6947935806626,\n",
       "                    152.93983211466667,\n",
       "                    197.1481400480321\n",
       "                ],\n",
       "                [\n",
       "                    0.9611585600880268,\n",
       "                    46.64283650085793,\n",
       "                    102.32004406296502,\n",
       "                    148.64094149067978,\n",
       "                    199.59803470854715\n",
       "                ],\n",
       "                [\n",
       "                    1.4310036755643463,\n",
       "                    50.15631363530299,\n",
       "                    102.68128938225942,\n",
       "                    147.52573154872948,\n",
       "                    197.6018158750086\n",
       "                ],\n",
       "                [\n",
       "                    0.492994684970105,\n",
       "                    43.23619663302313,\n",
       "                    99.60815322547333,\n",
       "                    140.00299600143438,\n",
       "                    198.97693156537883\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"label\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"inside\",\n",
       "                    \"color\": \"#fff\",\n",
       "                    \"margin\": 8\n",
       "                }\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"silent\": false,\n",
       "                \"precision\": 2,\n",
       "                \"label\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"top\",\n",
       "                    \"margin\": 8\n",
       "                }\n",
       "            },\n",
       "            \"tooltip\": {\n",
       "                \"show\": true,\n",
       "                \"trigger\": \"item\",\n",
       "                \"triggerOn\": \"mousemove|click\",\n",
       "                \"axisPointer\": {\n",
       "                    \"type\": \"line\"\n",
       "                },\n",
       "                \"showContent\": true,\n",
       "                \"alwaysShowContent\": false,\n",
       "                \"showDelay\": 0,\n",
       "                \"hideDelay\": 100,\n",
       "                \"formatter\": function(param) { return [                            'Experiment ' + param.name + ': ',                            'upper: ' + param.data[0],                            'Q1: ' + param.data[1],                            'median: ' + param.data[2],                            'Q3: ' + param.data[3],                            'lower: ' + param.data[4]                        ].join('<br/>') },\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 14\n",
       "                },\n",
       "                \"borderWidth\": 0,\n",
       "                \"padding\": 5\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"boxplot\",\n",
       "            \"name\": \"category1\",\n",
       "            \"data\": [\n",
       "                [\n",
       "                    1.3866777918670525,\n",
       "                    52.723984144413805,\n",
       "                    112.16068484025186,\n",
       "                    148.07060013196633,\n",
       "                    196.6493886555634\n",
       "                ],\n",
       "                [\n",
       "                    0.8675025485252785,\n",
       "                    41.94008605353009,\n",
       "                    90.4944101654473,\n",
       "                    134.34314089904032,\n",
       "                    199.57411732908722\n",
       "                ],\n",
       "                [\n",
       "                    2.109917782227244,\n",
       "                    47.361245156921306,\n",
       "                    98.03121935506474,\n",
       "                    152.57304498745683,\n",
       "                    199.6655667235125\n",
       "                ],\n",
       "                [\n",
       "                    0.835914742081334,\n",
       "                    45.90386054869363,\n",
       "                    110.8008994981315,\n",
       "                    153.77050147012113,\n",
       "                    198.17687983907325\n",
       "                ],\n",
       "                [\n",
       "                    0.09929780808608513,\n",
       "                    55.313979741487245,\n",
       "                    80.36049651385588,\n",
       "                    144.5076321261422,\n",
       "                    198.71007594348265\n",
       "                ],\n",
       "                [\n",
       "                    4.3591904343687204,\n",
       "                    53.098201381124454,\n",
       "                    88.8716562277704,\n",
       "                    134.2243571501588,\n",
       "                    197.86166497124387\n",
       "                ],\n",
       "                [\n",
       "                    1.4751642002043486,\n",
       "                    52.87727910767818,\n",
       "                    98.1167484613283,\n",
       "                    129.123794134296,\n",
       "                    199.26128215126036\n",
       "                ],\n",
       "                [\n",
       "                    1.0208468961246275,\n",
       "                    59.72883452828452,\n",
       "                    93.7117188714775,\n",
       "                    133.6955646934541,\n",
       "                    199.04002574913483\n",
       "                ],\n",
       "                [\n",
       "                    5.700580454086168,\n",
       "                    62.30214699943758,\n",
       "                    109.4858546359291,\n",
       "                    144.37435834128183,\n",
       "                    196.80025087232633\n",
       "                ],\n",
       "                [\n",
       "                    3.8776389962399627,\n",
       "                    47.07485197991684,\n",
       "                    108.77911010272065,\n",
       "                    143.55929331063112,\n",
       "                    199.78963194031576\n",
       "                ],\n",
       "                [\n",
       "                    0.9206486824532956,\n",
       "                    56.531536633466786,\n",
       "                    103.22722183226676,\n",
       "                    153.71850265606832,\n",
       "                    199.26707930050713\n",
       "                ],\n",
       "                [\n",
       "                    1.2238397462105866,\n",
       "                    42.37213742602606,\n",
       "                    85.0161099008823,\n",
       "                    144.6618761115177,\n",
       "                    195.68883739488717\n",
       "                ],\n",
       "                [\n",
       "                    1.383845313528731,\n",
       "                    55.58975449585246,\n",
       "                    101.2502031542653,\n",
       "                    155.4651069256266,\n",
       "                    198.51896538541257\n",
       "                ],\n",
       "                [\n",
       "                    2.460600698918336,\n",
       "                    45.35279677561122,\n",
       "                    86.22855211501036,\n",
       "                    142.2985968944624,\n",
       "                    196.88095181245973\n",
       "                ],\n",
       "                [\n",
       "                    1.5771786133238486,\n",
       "                    47.74919144071982,\n",
       "                    98.25948642595273,\n",
       "                    143.6080569193598,\n",
       "                    199.35657813436302\n",
       "                ],\n",
       "                [\n",
       "                    1.679597195618454,\n",
       "                    54.03099324959242,\n",
       "                    93.24925248108138,\n",
       "                    156.2197398880975,\n",
       "                    199.96087190538344\n",
       "                ],\n",
       "                [\n",
       "                    0.09445769268561222,\n",
       "                    62.987289799985746,\n",
       "                    93.5536375308287,\n",
       "                    146.10299624484736,\n",
       "                    198.89381360902073\n",
       "                ],\n",
       "                [\n",
       "                    0.5074418255246016,\n",
       "                    43.16902467382945,\n",
       "                    97.5036007943674,\n",
       "                    150.07249687988744,\n",
       "                    197.1438186145631\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"label\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"inside\",\n",
       "                    \"color\": \"#fff\",\n",
       "                    \"margin\": 8\n",
       "                }\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"silent\": false,\n",
       "                \"precision\": 2,\n",
       "                \"label\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"top\",\n",
       "                    \"margin\": 8\n",
       "                }\n",
       "            },\n",
       "            \"tooltip\": {\n",
       "                \"show\": true,\n",
       "                \"trigger\": \"item\",\n",
       "                \"triggerOn\": \"mousemove|click\",\n",
       "                \"axisPointer\": {\n",
       "                    \"type\": \"line\"\n",
       "                },\n",
       "                \"showContent\": true,\n",
       "                \"alwaysShowContent\": false,\n",
       "                \"showDelay\": 0,\n",
       "                \"hideDelay\": 100,\n",
       "                \"formatter\": function(param) { return [                            'Experiment ' + param.name + ': ',                            'upper: ' + param.data[0],                            'Q1: ' + param.data[1],                            'median: ' + param.data[2],                            'Q3: ' + param.data[3],                            'lower: ' + param.data[4]                        ].join('<br/>') },\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 14\n",
       "                },\n",
       "                \"borderWidth\": 0,\n",
       "                \"padding\": 5\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"boxplot\",\n",
       "            \"name\": \"category2\",\n",
       "            \"data\": [\n",
       "                [\n",
       "                    0.17336583192690824,\n",
       "                    38.89251480694969,\n",
       "                    95.24827036951726,\n",
       "                    144.42455874548153,\n",
       "                    199.4034309165705\n",
       "                ],\n",
       "                [\n",
       "                    3.676663641014155,\n",
       "                    56.915752270243615,\n",
       "                    116.52533365244228,\n",
       "                    154.9613826361874,\n",
       "                    199.45242610474344\n",
       "                ],\n",
       "                [\n",
       "                    0.2637149176087039,\n",
       "                    39.10809721270764,\n",
       "                    83.11646124189903,\n",
       "                    145.85305644883107,\n",
       "                    199.4425993969723\n",
       "                ],\n",
       "                [\n",
       "                    0.9435517891188017,\n",
       "                    59.34726771939571,\n",
       "                    116.9100457332774,\n",
       "                    154.6830501745436,\n",
       "                    197.360203327316\n",
       "                ],\n",
       "                [\n",
       "                    3.979089227580568,\n",
       "                    59.55958857930115,\n",
       "                    106.50956069508263,\n",
       "                    154.19233153204274,\n",
       "                    198.27863048295953\n",
       "                ],\n",
       "                [\n",
       "                    0.2254389425328185,\n",
       "                    45.14272916122666,\n",
       "                    101.99744565544017,\n",
       "                    158.20585382578935,\n",
       "                    199.87918467096276\n",
       "                ],\n",
       "                [\n",
       "                    0.4981747166813655,\n",
       "                    55.07500323828029,\n",
       "                    98.06775843874871,\n",
       "                    142.6740673515219,\n",
       "                    196.17733451641203\n",
       "                ],\n",
       "                [\n",
       "                    3.459413844168191,\n",
       "                    48.45434370508197,\n",
       "                    90.08287035261958,\n",
       "                    144.44636703035508,\n",
       "                    196.7330418635301\n",
       "                ],\n",
       "                [\n",
       "                    5.491046107788211,\n",
       "                    51.726853187011294,\n",
       "                    102.73451029578627,\n",
       "                    144.81711164442441,\n",
       "                    198.8867176824325\n",
       "                ],\n",
       "                [\n",
       "                    0.7550472434538769,\n",
       "                    52.51096431201062,\n",
       "                    107.88318214869264,\n",
       "                    159.26961432919137,\n",
       "                    199.61830476130777\n",
       "                ],\n",
       "                [\n",
       "                    0.2752001848587593,\n",
       "                    48.7398963427885,\n",
       "                    89.75616732426943,\n",
       "                    142.05594236584855,\n",
       "                    198.3147751483816\n",
       "                ],\n",
       "                [\n",
       "                    1.4946063684317945,\n",
       "                    47.50894653631401,\n",
       "                    98.11186814575922,\n",
       "                    138.51943571666908,\n",
       "                    193.3052139732351\n",
       "                ],\n",
       "                [\n",
       "                    0.20882224269564986,\n",
       "                    51.28631550804623,\n",
       "                    107.81597798598389,\n",
       "                    160.02354609263347,\n",
       "                    199.2878557923929\n",
       "                ],\n",
       "                [\n",
       "                    0.8976637474841898,\n",
       "                    43.66029575375894,\n",
       "                    100.62231619788403,\n",
       "                    139.9661197041632,\n",
       "                    192.54845617677\n",
       "                ],\n",
       "                [\n",
       "                    5.859745717489284,\n",
       "                    47.03805156535355,\n",
       "                    108.41470873842098,\n",
       "                    157.096784096105,\n",
       "                    199.9179863824041\n",
       "                ],\n",
       "                [\n",
       "                    3.7257707586363598,\n",
       "                    42.231249941095996,\n",
       "                    97.356821000705,\n",
       "                    142.79191220154834,\n",
       "                    198.84036692134\n",
       "                ],\n",
       "                [\n",
       "                    1.8454208635465985,\n",
       "                    44.91333687646406,\n",
       "                    98.65350096972611,\n",
       "                    143.39018022926803,\n",
       "                    199.87483964263296\n",
       "                ],\n",
       "                [\n",
       "                    0.5514923538800787,\n",
       "                    45.85216189462081,\n",
       "                    99.9806157446917,\n",
       "                    153.32082407525542,\n",
       "                    198.2776454910153\n",
       "                ]\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"markPoint\": {\n",
       "                \"label\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"inside\",\n",
       "                    \"color\": \"#fff\",\n",
       "                    \"margin\": 8\n",
       "                }\n",
       "            },\n",
       "            \"markLine\": {\n",
       "                \"silent\": false,\n",
       "                \"precision\": 2,\n",
       "                \"label\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"top\",\n",
       "                    \"margin\": 8\n",
       "                }\n",
       "            },\n",
       "            \"tooltip\": {\n",
       "                \"show\": true,\n",
       "                \"trigger\": \"item\",\n",
       "                \"triggerOn\": \"mousemove|click\",\n",
       "                \"axisPointer\": {\n",
       "                    \"type\": \"line\"\n",
       "                },\n",
       "                \"showContent\": true,\n",
       "                \"alwaysShowContent\": false,\n",
       "                \"showDelay\": 0,\n",
       "                \"hideDelay\": 100,\n",
       "                \"formatter\": function(param) { return [                            'Experiment ' + param.name + ': ',                            'upper: ' + param.data[0],                            'Q1: ' + param.data[1],                            'median: ' + param.data[2],                            'Q3: ' + param.data[3],                            'lower: ' + param.data[4]                        ].join('<br/>') },\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 14\n",
       "                },\n",
       "                \"borderWidth\": 0,\n",
       "                \"padding\": 5\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"category0\",\n",
       "                \"category1\",\n",
       "                \"category2\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"category0\": true,\n",
       "                \"category1\": true,\n",
       "                \"category2\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"top\": \"3%\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"shadow\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 30,\n",
       "            \"gridIndex\": 0,\n",
       "            \"axisLabel\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8,\n",
       "                \"formatter\": \"expr {value}\"\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"boundaryGap\": true,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"splitArea\": {\n",
       "                \"show\": true,\n",
       "                \"areaStyle\": {\n",
       "                    \"opacity\": 1\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"0\",\n",
       "                \"1\",\n",
       "                \"2\",\n",
       "                \"3\",\n",
       "                \"4\",\n",
       "                \"5\",\n",
       "                \"6\",\n",
       "                \"7\",\n",
       "                \"8\",\n",
       "                \"9\",\n",
       "                \"10\",\n",
       "                \"11\",\n",
       "                \"12\",\n",
       "                \"13\",\n",
       "                \"14\",\n",
       "                \"15\",\n",
       "                \"16\",\n",
       "                \"17\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"type\": \"value\",\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"min\": -400,\n",
       "            \"max\": 600,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"splitArea\": {\n",
       "                \"show\": false,\n",
       "                \"areaStyle\": {\n",
       "                    \"opacity\": 0\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Multiple Categories\",\n",
       "            \"left\": \"center\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ],\n",
       "    \"dataZoom\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"type\": \"inside\",\n",
       "            \"realtime\": true,\n",
       "            \"start\": 0,\n",
       "            \"end\": 20,\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"zoomLock\": false,\n",
       "            \"filterMode\": \"filter\"\n",
       "        },\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"type\": \"slider\",\n",
       "            \"realtime\": true,\n",
       "            \"start\": 20,\n",
       "            \"end\": 80,\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"xAxisIndex\": 0,\n",
       "            \"zoomLock\": false,\n",
       "            \"filterMode\": \"filter\"\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_22cb15d67b23406cb56876db2474c2fb.setOption(option_22cb15d67b23406cb56876db2474c2fb);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x7f419755fac8>"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts.commons.utils import JsCode\n",
    "axis_data = [\n",
    "    \"0\",\n",
    "    \"1\",\n",
    "    \"2\",\n",
    "    \"3\",\n",
    "    \"4\",\n",
    "    \"5\",\n",
    "    \"6\",\n",
    "    \"7\",\n",
    "    \"8\",\n",
    "    \"9\",\n",
    "    \"10\",\n",
    "    \"11\",\n",
    "    \"12\",\n",
    "    \"13\",\n",
    "    \"14\",\n",
    "    \"15\",\n",
    "    \"16\",\n",
    "    \"17\",\n",
    "]\n",
    "\n",
    "data = [\n",
    "    {\n",
    "        \"axisData\": axis_data,\n",
    "        \"boxData\": [\n",
    "            [\n",
    "                3.8888578346043534,\n",
    "                55.82692798765428,\n",
    "                98.71608835477272,\n",
    "                149.50917642877687,\n",
    "                196.31621070646452,\n",
    "            ],\n",
    "            [\n",
    "                0.5174326704765253,\n",
    "                47.52990128406776,\n",
    "                103.66600287106233,\n",
    "                160.1380046605997,\n",
    "                194.8294269298398,\n",
    "            ],\n",
    "            [\n",
    "                2.843900448603165,\n",
    "                51.773788199388605,\n",
    "                90.66830693679475,\n",
    "                152.19938074181786,\n",
    "                196.18172012742428,\n",
    "            ],\n",
    "            [\n",
    "                2.6752702891334135,\n",
    "                42.85051429480143,\n",
    "                98.54433643572133,\n",
    "                166.81852013033875,\n",
    "                199.7400516615198,\n",
    "            ],\n",
    "            [\n",
    "                1.665511467481906,\n",
    "                63.069856326089585,\n",
    "                123.20638438572043,\n",
    "                164.0932194814393,\n",
    "                199.56631692214057,\n",
    "            ],\n",
    "            [\n",
    "                0.3597414263118992,\n",
    "                52.84424125860876,\n",
    "                108.14491539985673,\n",
    "                154.42390255012828,\n",
    "                199.39872381823812,\n",
    "            ],\n",
    "            [\n",
    "                1.3380322954592128,\n",
    "                41.989379994726335,\n",
    "                100.39118095266713,\n",
    "                160.38742881881478,\n",
    "                197.8251968350275,\n",
    "            ],\n",
    "            [\n",
    "                1.7005873932608662,\n",
    "                43.88170786936796,\n",
    "                92.29415890464293,\n",
    "                140.7858956683471,\n",
    "                197.50510824352313,\n",
    "            ],\n",
    "            [\n",
    "                1.7017445023542965,\n",
    "                52.55872982785781,\n",
    "                90.26972335102536,\n",
    "                155.43082163069883,\n",
    "                198.31679368721197,\n",
    "            ],\n",
    "            [\n",
    "                0.45657888665799895,\n",
    "                47.60747957375436,\n",
    "                95.53917053451289,\n",
    "                162.55256484073354,\n",
    "                199.78317232079928,\n",
    "            ],\n",
    "            [\n",
    "                1.745438082254136,\n",
    "                53.450845301261964,\n",
    "                95.8847297380051,\n",
    "                143.99885640751006,\n",
    "                195.1863502057908,\n",
    "            ],\n",
    "            [\n",
    "                2.5631287114048273,\n",
    "                56.04486879215165,\n",
    "                110.01592256847306,\n",
    "                155.33508398386462,\n",
    "                195.90291395560985,\n",
    "            ],\n",
    "            [\n",
    "                3.4380745785991262,\n",
    "                58.07888602010247,\n",
    "                105.64925213947652,\n",
    "                165.50126442985191,\n",
    "                199.75877487248675,\n",
    "            ],\n",
    "            [\n",
    "                0.03322930419802361,\n",
    "                53.363159200883985,\n",
    "                95.32936635574816,\n",
    "                151.39772626598614,\n",
    "                198.20394907387762,\n",
    "            ],\n",
    "            [\n",
    "                0.7063564158257929,\n",
    "                73.89369564248534,\n",
    "                116.6947935806626,\n",
    "                152.93983211466667,\n",
    "                197.1481400480321,\n",
    "            ],\n",
    "            [\n",
    "                0.9611585600880268,\n",
    "                46.64283650085793,\n",
    "                102.32004406296502,\n",
    "                148.64094149067978,\n",
    "                199.59803470854715,\n",
    "            ],\n",
    "            [\n",
    "                1.4310036755643463,\n",
    "                50.15631363530299,\n",
    "                102.68128938225942,\n",
    "                147.52573154872948,\n",
    "                197.6018158750086,\n",
    "            ],\n",
    "            [\n",
    "                0.492994684970105,\n",
    "                43.23619663302313,\n",
    "                99.60815322547333,\n",
    "                140.00299600143438,\n",
    "                198.97693156537883,\n",
    "            ],\n",
    "        ],\n",
    "        \"outliers\": [],\n",
    "    },\n",
    "    {\n",
    "        \"axisData\": axis_data,\n",
    "        \"boxData\": [\n",
    "            [\n",
    "                1.3866777918670525,\n",
    "                52.723984144413805,\n",
    "                112.16068484025186,\n",
    "                148.07060013196633,\n",
    "                196.6493886555634,\n",
    "            ],\n",
    "            [\n",
    "                0.8675025485252785,\n",
    "                41.94008605353009,\n",
    "                90.4944101654473,\n",
    "                134.34314089904032,\n",
    "                199.57411732908722,\n",
    "            ],\n",
    "            [\n",
    "                2.109917782227244,\n",
    "                47.361245156921306,\n",
    "                98.03121935506474,\n",
    "                152.57304498745683,\n",
    "                199.6655667235125,\n",
    "            ],\n",
    "            [\n",
    "                0.835914742081334,\n",
    "                45.90386054869363,\n",
    "                110.8008994981315,\n",
    "                153.77050147012113,\n",
    "                198.17687983907325,\n",
    "            ],\n",
    "            [\n",
    "                0.09929780808608513,\n",
    "                55.313979741487245,\n",
    "                80.36049651385588,\n",
    "                144.5076321261422,\n",
    "                198.71007594348265,\n",
    "            ],\n",
    "            [\n",
    "                4.3591904343687204,\n",
    "                53.098201381124454,\n",
    "                88.8716562277704,\n",
    "                134.2243571501588,\n",
    "                197.86166497124387,\n",
    "            ],\n",
    "            [\n",
    "                1.4751642002043486,\n",
    "                52.87727910767818,\n",
    "                98.1167484613283,\n",
    "                129.123794134296,\n",
    "                199.26128215126036,\n",
    "            ],\n",
    "            [\n",
    "                1.0208468961246275,\n",
    "                59.72883452828452,\n",
    "                93.7117188714775,\n",
    "                133.6955646934541,\n",
    "                199.04002574913483,\n",
    "            ],\n",
    "            [\n",
    "                5.700580454086168,\n",
    "                62.30214699943758,\n",
    "                109.4858546359291,\n",
    "                144.37435834128183,\n",
    "                196.80025087232633,\n",
    "            ],\n",
    "            [\n",
    "                3.8776389962399627,\n",
    "                47.07485197991684,\n",
    "                108.77911010272065,\n",
    "                143.55929331063112,\n",
    "                199.78963194031576,\n",
    "            ],\n",
    "            [\n",
    "                0.9206486824532956,\n",
    "                56.531536633466786,\n",
    "                103.22722183226676,\n",
    "                153.71850265606832,\n",
    "                199.26707930050713,\n",
    "            ],\n",
    "            [\n",
    "                1.2238397462105866,\n",
    "                42.37213742602606,\n",
    "                85.0161099008823,\n",
    "                144.6618761115177,\n",
    "                195.68883739488717,\n",
    "            ],\n",
    "            [\n",
    "                1.383845313528731,\n",
    "                55.58975449585246,\n",
    "                101.2502031542653,\n",
    "                155.4651069256266,\n",
    "                198.51896538541257,\n",
    "            ],\n",
    "            [\n",
    "                2.460600698918336,\n",
    "                45.35279677561122,\n",
    "                86.22855211501036,\n",
    "                142.2985968944624,\n",
    "                196.88095181245973,\n",
    "            ],\n",
    "            [\n",
    "                1.5771786133238486,\n",
    "                47.74919144071982,\n",
    "                98.25948642595273,\n",
    "                143.6080569193598,\n",
    "                199.35657813436302,\n",
    "            ],\n",
    "            [\n",
    "                1.679597195618454,\n",
    "                54.03099324959242,\n",
    "                93.24925248108138,\n",
    "                156.2197398880975,\n",
    "                199.96087190538344,\n",
    "            ],\n",
    "            [\n",
    "                0.09445769268561222,\n",
    "                62.987289799985746,\n",
    "                93.5536375308287,\n",
    "                146.10299624484736,\n",
    "                198.89381360902073,\n",
    "            ],\n",
    "            [\n",
    "                0.5074418255246016,\n",
    "                43.16902467382945,\n",
    "                97.5036007943674,\n",
    "                150.07249687988744,\n",
    "                197.1438186145631,\n",
    "            ],\n",
    "        ],\n",
    "        \"outliers\": [],\n",
    "    },\n",
    "    {\n",
    "        \"axisData\": axis_data,\n",
    "        \"boxData\": [\n",
    "            [\n",
    "                0.17336583192690824,\n",
    "                38.89251480694969,\n",
    "                95.24827036951726,\n",
    "                144.42455874548153,\n",
    "                199.4034309165705,\n",
    "            ],\n",
    "            [\n",
    "                3.676663641014155,\n",
    "                56.915752270243615,\n",
    "                116.52533365244228,\n",
    "                154.9613826361874,\n",
    "                199.45242610474344,\n",
    "            ],\n",
    "            [\n",
    "                0.2637149176087039,\n",
    "                39.10809721270764,\n",
    "                83.11646124189903,\n",
    "                145.85305644883107,\n",
    "                199.4425993969723,\n",
    "            ],\n",
    "            [\n",
    "                0.9435517891188017,\n",
    "                59.34726771939571,\n",
    "                116.9100457332774,\n",
    "                154.6830501745436,\n",
    "                197.360203327316,\n",
    "            ],\n",
    "            [\n",
    "                3.979089227580568,\n",
    "                59.55958857930115,\n",
    "                106.50956069508263,\n",
    "                154.19233153204274,\n",
    "                198.27863048295953,\n",
    "            ],\n",
    "            [\n",
    "                0.2254389425328185,\n",
    "                45.14272916122666,\n",
    "                101.99744565544017,\n",
    "                158.20585382578935,\n",
    "                199.87918467096276,\n",
    "            ],\n",
    "            [\n",
    "                0.4981747166813655,\n",
    "                55.07500323828029,\n",
    "                98.06775843874871,\n",
    "                142.6740673515219,\n",
    "                196.17733451641203,\n",
    "            ],\n",
    "            [\n",
    "                3.459413844168191,\n",
    "                48.45434370508197,\n",
    "                90.08287035261958,\n",
    "                144.44636703035508,\n",
    "                196.7330418635301,\n",
    "            ],\n",
    "            [\n",
    "                5.491046107788211,\n",
    "                51.726853187011294,\n",
    "                102.73451029578627,\n",
    "                144.81711164442441,\n",
    "                198.8867176824325,\n",
    "            ],\n",
    "            [\n",
    "                0.7550472434538769,\n",
    "                52.51096431201062,\n",
    "                107.88318214869264,\n",
    "                159.26961432919137,\n",
    "                199.61830476130777,\n",
    "            ],\n",
    "            [\n",
    "                0.2752001848587593,\n",
    "                48.7398963427885,\n",
    "                89.75616732426943,\n",
    "                142.05594236584855,\n",
    "                198.3147751483816,\n",
    "            ],\n",
    "            [\n",
    "                1.4946063684317945,\n",
    "                47.50894653631401,\n",
    "                98.11186814575922,\n",
    "                138.51943571666908,\n",
    "                193.3052139732351,\n",
    "            ],\n",
    "            [\n",
    "                0.20882224269564986,\n",
    "                51.28631550804623,\n",
    "                107.81597798598389,\n",
    "                160.02354609263347,\n",
    "                199.2878557923929,\n",
    "            ],\n",
    "            [\n",
    "                0.8976637474841898,\n",
    "                43.66029575375894,\n",
    "                100.62231619788403,\n",
    "                139.9661197041632,\n",
    "                192.54845617677,\n",
    "            ],\n",
    "            [\n",
    "                5.859745717489284,\n",
    "                47.03805156535355,\n",
    "                108.41470873842098,\n",
    "                157.096784096105,\n",
    "                199.9179863824041,\n",
    "            ],\n",
    "            [\n",
    "                3.7257707586363598,\n",
    "                42.231249941095996,\n",
    "                97.356821000705,\n",
    "                142.79191220154834,\n",
    "                198.84036692134,\n",
    "            ],\n",
    "            [\n",
    "                1.8454208635465985,\n",
    "                44.91333687646406,\n",
    "                98.65350096972611,\n",
    "                143.39018022926803,\n",
    "                199.87483964263296,\n",
    "            ],\n",
    "            [\n",
    "                0.5514923538800787,\n",
    "                45.85216189462081,\n",
    "                99.9806157446917,\n",
    "                153.32082407525542,\n",
    "                198.2776454910153,\n",
    "            ],\n",
    "        ],\n",
    "        \"outliers\": [],\n",
    "    },\n",
    "    {\n",
    "        \"axisData\": axis_data,\n",
    "        \"boxData\": [\n",
    "            [\n",
    "                0.7168805200240325,\n",
    "                46.53681449735687,\n",
    "                97.29254353668016,\n",
    "                156.63006806530143,\n",
    "                199.3015739378797,\n",
    "            ],\n",
    "            [\n",
    "                1.7193486665883828,\n",
    "                62.95172603462959,\n",
    "                112.02740143118092,\n",
    "                156.0538383864632,\n",
    "                199.26142301676774,\n",
    "            ],\n",
    "            [\n",
    "                2.1369256823901672,\n",
    "                57.21732276358834,\n",
    "                103.36834727083514,\n",
    "                153.72092303549277,\n",
    "                198.79539179393552,\n",
    "            ],\n",
    "            [\n",
    "                0.032880351113817596,\n",
    "                47.562260234793726,\n",
    "                96.26764103515997,\n",
    "                145.73458375286407,\n",
    "                199.06617414977254,\n",
    "            ],\n",
    "            [\n",
    "                0.4401537603581307,\n",
    "                43.865273442582165,\n",
    "                94.93675834281308,\n",
    "                146.35738146359748,\n",
    "                193.64127816517245,\n",
    "            ],\n",
    "            [\n",
    "                0.3961689590249673,\n",
    "                50.96909350725202,\n",
    "                104.73604524329194,\n",
    "                148.23414082526403,\n",
    "                198.8856874527377,\n",
    "            ],\n",
    "            [\n",
    "                0.21937305368529003,\n",
    "                49.59183574690416,\n",
    "                102.85949468466653,\n",
    "                163.6266324963084,\n",
    "                199.69745130954797,\n",
    "            ],\n",
    "            [\n",
    "                0.6248639849676607,\n",
    "                43.65587924550377,\n",
    "                98.38900488209111,\n",
    "                152.00850019757138,\n",
    "                197.66849547068205,\n",
    "            ],\n",
    "            [\n",
    "                0.8836653304501674,\n",
    "                51.715354680095054,\n",
    "                106.27634207918453,\n",
    "                152.75520182409605,\n",
    "                198.7026018674421,\n",
    "            ],\n",
    "            [\n",
    "                7.037170236614809,\n",
    "                60.499053468218285,\n",
    "                99.70265208133726,\n",
    "                145.547153860169,\n",
    "                197.56589704383606,\n",
    "            ],\n",
    "            [\n",
    "                0.191005947981715,\n",
    "                36.77501191389064,\n",
    "                78.79138996882105,\n",
    "                138.31773623910374,\n",
    "                199.5549011391389,\n",
    "            ],\n",
    "            [\n",
    "                2.085660638228548,\n",
    "                50.85562917320624,\n",
    "                100.31437027035244,\n",
    "                144.07227532917557,\n",
    "                199.9671689855977,\n",
    "            ],\n",
    "            [\n",
    "                2.8329465269889997,\n",
    "                46.64735576556238,\n",
    "                95.58042897665536,\n",
    "                150.95016495791145,\n",
    "                199.01002263253537,\n",
    "            ],\n",
    "            [\n",
    "                2.9140730838620232,\n",
    "                55.8981643150491,\n",
    "                99.12490122897461,\n",
    "                138.35381332244458,\n",
    "                197.89764340001602,\n",
    "            ],\n",
    "            [\n",
    "                0.6900722343886834,\n",
    "                61.20627193426343,\n",
    "                108.73896996351209,\n",
    "                152.38197094149575,\n",
    "                199.49695739258172,\n",
    "            ],\n",
    "            [\n",
    "                0.3519848056308117,\n",
    "                51.38799178079926,\n",
    "                108.74191700174138,\n",
    "                146.60812022274987,\n",
    "                198.09008264810322,\n",
    "            ],\n",
    "            [\n",
    "                0.2761553645218129,\n",
    "                56.388967149570455,\n",
    "                104.8697135719724,\n",
    "                153.5049030271958,\n",
    "                199.5731857965878,\n",
    "            ],\n",
    "            [\n",
    "                3.5557869592812708,\n",
    "                46.14828237062535,\n",
    "                108.66363220203428,\n",
    "                160.07663258712037,\n",
    "                199.1028921688903,\n",
    "            ],\n",
    "        ],\n",
    "        \"outliers\": [],\n",
    "    },\n",
    "    {\n",
    "        \"axisData\": axis_data,\n",
    "        \"boxData\": [\n",
    "            [\n",
    "                2.979477505147443,\n",
    "                39.75713406508555,\n",
    "                94.53079422141971,\n",
    "                156.08283690923398,\n",
    "                199.44795240229735,\n",
    "            ],\n",
    "            [\n",
    "                2.6484190473881064,\n",
    "                39.93623770385512,\n",
    "                77.27669464380185,\n",
    "                128.4315475425753,\n",
    "                199.56482718369725,\n",
    "            ],\n",
    "            [\n",
    "                0.027555734890816197,\n",
    "                57.0338837796717,\n",
    "                108.81399073964846,\n",
    "                148.06814743102228,\n",
    "                199.60110925244555,\n",
    "            ],\n",
    "            [\n",
    "                5.095524117378636,\n",
    "                61.306047315630614,\n",
    "                110.93776130670011,\n",
    "                156.1408460056575,\n",
    "                195.24807037634693,\n",
    "            ],\n",
    "            [\n",
    "                2.728611345602383,\n",
    "                44.56605304153001,\n",
    "                82.24512299722713,\n",
    "                147.52018338217582,\n",
    "                197.4401254594119,\n",
    "            ],\n",
    "            [\n",
    "                3.2844003726598903,\n",
    "                31.22917030540313,\n",
    "                98.82341804522095,\n",
    "                147.37909270120065,\n",
    "                195.31234405750303,\n",
    "            ],\n",
    "            [\n",
    "                0.18212434446978065,\n",
    "                59.703454603359305,\n",
    "                103.67261216911498,\n",
    "                144.78603398715182,\n",
    "                197.894221292169,\n",
    "            ],\n",
    "            [\n",
    "                2.0723859910971587,\n",
    "                65.62630968779271,\n",
    "                108.08425190082599,\n",
    "                153.04828999176155,\n",
    "                198.71953877580813,\n",
    "            ],\n",
    "            [\n",
    "                0.9675695750262392,\n",
    "                52.06976077477188,\n",
    "                106.44774448853506,\n",
    "                153.71491587328123,\n",
    "                199.9367145735771,\n",
    "            ],\n",
    "            [\n",
    "                2.5328359424461766,\n",
    "                54.040914797213425,\n",
    "                98.74095548976766,\n",
    "                156.68297214273787,\n",
    "                199.54362057796757,\n",
    "            ],\n",
    "            [\n",
    "                1.1331529861684952,\n",
    "                44.39864814947693,\n",
    "                88.34657630798353,\n",
    "                137.22778263394855,\n",
    "                198.83623456218217,\n",
    "            ],\n",
    "            [\n",
    "                0.03400372259445561,\n",
    "                39.0412178839992,\n",
    "                82.44989003395962,\n",
    "                142.39781316172628,\n",
    "                198.66240858068616,\n",
    "            ],\n",
    "            [\n",
    "                3.3739669830866514,\n",
    "                51.553716623716575,\n",
    "                113.01026058884891,\n",
    "                165.92964939460416,\n",
    "                198.22988431223231,\n",
    "            ],\n",
    "            [\n",
    "                1.7144280578984095,\n",
    "                52.52972703008254,\n",
    "                97.47299182400204,\n",
    "                134.9644807802092,\n",
    "                198.46967348342878,\n",
    "            ],\n",
    "            [\n",
    "                1.7893968468841948,\n",
    "                43.87294943558785,\n",
    "                90.42735899685948,\n",
    "                143.0586276081752,\n",
    "                197.6798595904976,\n",
    "            ],\n",
    "            [\n",
    "                4.299131337916773,\n",
    "                50.29192506963852,\n",
    "                104.5869339834448,\n",
    "                163.2705302681331,\n",
    "                199.10157077449355,\n",
    "            ],\n",
    "            [\n",
    "                0.6740610620747933,\n",
    "                54.02651804107089,\n",
    "                86.12616850846155,\n",
    "                137.7008290515613,\n",
    "                199.78999859299336,\n",
    "            ],\n",
    "            [\n",
    "                0.5370189113081292,\n",
    "                50.44519588101707,\n",
    "                98.08928065026996,\n",
    "                139.8482090057953,\n",
    "                197.20820681141507,\n",
    "            ],\n",
    "        ],\n",
    "        \"outliers\": [],\n",
    "    },\n",
    "]\n",
    "\n",
    "dlhzt = (\n",
    "    Boxplot()\n",
    "    .add_xaxis(xaxis_data=axis_data)\n",
    "    .add_yaxis(\n",
    "        series_name=\"category0\",\n",
    "        y_axis=data[0][\"boxData\"],\n",
    "        tooltip_opts=opts.TooltipOpts(\n",
    "            formatter=JsCode(\n",
    "                \"\"\"function(param) { return [\n",
    "                            'Experiment ' + param.name + ': ',\n",
    "                            'upper: ' + param.data[0],\n",
    "                            'Q1: ' + param.data[1],\n",
    "                            'median: ' + param.data[2],\n",
    "                            'Q3: ' + param.data[3],\n",
    "                            'lower: ' + param.data[4]\n",
    "                        ].join('<br/>') }\"\"\"\n",
    "            )\n",
    "        ),\n",
    "    )\n",
    "    .add_yaxis(\n",
    "        series_name=\"category1\",\n",
    "        y_axis=data[1][\"boxData\"],\n",
    "        tooltip_opts=opts.TooltipOpts(\n",
    "            formatter=JsCode(\n",
    "                \"\"\"function(param) { return [\n",
    "                            'Experiment ' + param.name + ': ',\n",
    "                            'upper: ' + param.data[0],\n",
    "                            'Q1: ' + param.data[1],\n",
    "                            'median: ' + param.data[2],\n",
    "                            'Q3: ' + param.data[3],\n",
    "                            'lower: ' + param.data[4]\n",
    "                        ].join('<br/>') }\"\"\"\n",
    "            )\n",
    "        ),\n",
    "    )\n",
    "    .add_yaxis(\n",
    "        series_name=\"category2\",\n",
    "        y_axis=data[2][\"boxData\"],\n",
    "        tooltip_opts=opts.TooltipOpts(\n",
    "            formatter=JsCode(\n",
    "                \"\"\"function(param) { return [\n",
    "                            'Experiment ' + param.name + ': ',\n",
    "                            'upper: ' + param.data[0],\n",
    "                            'Q1: ' + param.data[1],\n",
    "                            'median: ' + param.data[2],\n",
    "                            'Q3: ' + param.data[3],\n",
    "                            'lower: ' + param.data[4]\n",
    "                        ].join('<br/>') }\"\"\"\n",
    "            )\n",
    "        ),\n",
    "    )\n",
    "    .set_global_opts(\n",
    "        title_opts=opts.TitleOpts(title=\"Multiple Categories\", pos_left=\"center\"),\n",
    "        legend_opts=opts.LegendOpts(pos_top=\"3%\"),\n",
    "        tooltip_opts=opts.TooltipOpts(trigger=\"item\", axis_pointer_type=\"shadow\"),\n",
    "        xaxis_opts=opts.AxisOpts(\n",
    "            name_gap=30,\n",
    "            boundary_gap=True,\n",
    "            splitarea_opts=opts.SplitAreaOpts(\n",
    "                areastyle_opts=opts.AreaStyleOpts(opacity=1)\n",
    "            ),\n",
    "            axislabel_opts=opts.LabelOpts(formatter=\"expr {value}\"),\n",
    "            splitline_opts=opts.SplitLineOpts(is_show=False),\n",
    "        ),\n",
    "        yaxis_opts=opts.AxisOpts(\n",
    "            type_=\"value\",\n",
    "            min_=-400,\n",
    "            max_=600,\n",
    "            splitarea_opts=opts.SplitAreaOpts(is_show=False),\n",
    "        ),\n",
    "        datazoom_opts=[\n",
    "            opts.DataZoomOpts(type_=\"inside\", range_start=0, range_end=20),\n",
    "            opts.DataZoomOpts(type_=\"slider\", xaxis_index=0, is_show=True),\n",
    "        ],\n",
    "    )\n",
    "    #.render(\"multiple_categories.html\")\n",
    ")\n",
    "dlhzt.load_javascript()\n",
    "dlhzt.render_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
